import * as mongoose from 'mongoose';
import * as mongodb from 'mongodb';
import config from './../config';
const { mongoodb } = config;
mongoose.connect(`mongodb://${mongoodb.host}`, {
    poolSize: mongoodb.poolSize,
    auth: mongoodb.auth
}, function (error: mongodb.MongoError) {
    if (error) {
        console.log(error.message);
        process.exit(1);
    }
});
import './user';
import './commodity';
import './menu';
import './role';
import './commodityType';

export const User = mongoose.model('User');
export const Commodity = mongoose.model('Commodity');
export const Menu = mongoose.model('Menu');
export const Role = mongoose.model('Role');
export const CommodityType = mongoose.model('CommodityType');
